﻿using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using EnvDTE80;
using Microsoft.VisualStudio.ComponentModelHost;

namespace Dsl.Ped.Designer.Utils
{
    public class VsUtils
    {
        public static IComponentModel GetComponentModel()
        {
            var dte2 = (DTE2)Package.GetGlobalService(typeof(SDTE));
            var sp = new ServiceProvider(dte2 as Microsoft.VisualStudio.OLE.Interop.IServiceProvider);
            var container = sp.GetService(typeof(SComponentModel)) as IComponentModel;

            return container;
        }
    }
}
